package com.dao;

import com.controller.ResourceCtl;
import com.util.AjaxResult;
import com.vo.ResourceVo;
import com.vo.UserResource;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


import com.entity.Resource;
import org.springframework.stereotype.Repository;

@Repository
public interface ResourceMapper {
    //    用户删除资源 pj
    public int removeFrontResource(int id);

    //    panjun
//    List findBackResource(int id);
    //添加新资源
    int addFrontResource(Resource resource);

    //    前,后台查询资源 pj
    List<Resource> findBackResource(ResourceVo resourceVo);

    //    修改启用禁用 pj
    public int toggleStatus(Resource resource);

    //根据id查询resource pj
    public Resource findResourceByid(Integer resourceId);


    //根据CourseId查询Resource
    //@李奇洲
    public Resource selectResourceByResourceId(Integer course_id);

    //根据UserId和ResourceId查询购买记录
    public UserResource selectUserResourceByUidAndResId(@Param("uid") Integer uid,@Param("resid") Integer resid);
    //插入购买记录
    public int insertUserResource(UserResource resource);
}
